function _const(key,value) {
    const desc = {
        value,
        writable: false
    }
    Object.defineProperty(window, key, desc)
}

_const('obj', {a: 1})
obj.b = 2
obj = {}